package com.leetcode.LC;

public class LC70 {
    public int climbStairs(int n) {
        if (n==1)
            return 1;
        if (n==2)
            return 2;
        int[] ints = new int[n];
        ints[0]=1;
        ints[1]=2;
        for (int i = 0; i < n-2; i++) {
            ints[i+2]=ints[i+1]+ints[i];
        }

        return ints[n-1];
    }

    public static void main(String[] args) {
        System.out.println(new LC70().climbStairs(4));
    }
}
